package com.ylbh.modules.businessorder.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ylbh.common.pojo.businessorder.dto.BusinessOrderDTO;
import com.ylbh.common.pojo.businessorder.vo.*;
import com.ylbh.modules.businessorder.entity.ShoppingBusinessOrder;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 *
 *
 * @author czx
 * @date 2019-04-17 14:10:36
 */
@Mapper
@Repository
public interface ShoppingBusinessOrderMapper extends BaseMapper<ShoppingBusinessOrder> {

    /**
     * 联盟店订单列表
     * @param businessOrderDTO
     * @param page
     * @return
     */
    List<BusinessOrderListVO> selectBusinessOrderList(BusinessOrderDTO businessOrderDTO, Page page);

    /**
     * 联盟店订单详情
     * @param id
     * @return
     */
    BusinessOrderDetailsVO selectOrderById(Long id);

    /**
     * 返回订单的所有商品名称
     * @param payNo
     * @return
     */
	String selectGoodsNameByPayNo(String payNo);

    /**
     * 子订单列表
     * @param orderNo
     * @return
     */
    List<SubOrderVO> selectSonOrderList(String orderNo);

    /**
     * 子订单详情
     * @param id
     * @return
     */
    SubOrderDetailsVO selectSonOrderDetails(String id);

    /**
     * 导出联盟店订单
     * @return
     */
    List<BusinessOrderExcelVO> selectBusinessOrderExcel(@Param(value = "payStatus")String payStatus, @Param(value = "payType")String payType, @Param(value = "startTime")String startTime,@Param(value = "endTime")String endTime,@Param(value = "keywords")String keywords);

    /**
     * 查询出运营商负责人
     * @param userName
     * @return
     */
    String selectRealNameByUserName(@Param(value = "userName") String userName);

    /**
     * 联盟店线下订单详情
     * @param id
     * @return
     */
    BusinessOrderDetailsVO selectBusinessOrderById(Long id);

    /**
     * 联盟店线下买单详情
     * @param id
     * @return
     */
    BusinessOrderDetailsVO selectPayInfoById(Long id);

    /**
     * 联盟店详情-新版
     * @param id
     * @return
     */
    NewBusinessOrderDetailsVO selectNewBusinessOrder(Long id);

    /**
     * 查询该笔订单里的商品
     * @param orderNo
     * @return
     */
    List<NewBusinessGoodsVO> selectNewOrderGoods(String orderNo);

    /**
     * 买单或扫码详情
     * @param payNo
     * @return
     */
    NewBusinessOrderDetailsVO selectNewPayInfoById(String payNo);

    // 根据订单号查询详情
    NewBusinessOrderDetailsVO selectNewBusinessOrderByNo(String no);

//    OrderTestVO selectOrderUserByUserName(String userName);
//
//    void insertBusinessOrder(ShoppingBusinessOrder order);
}
